package com.su.test.testdemo;

import android.hardware.Camera;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.SurfaceHolder;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;

import com.su.test.testdemo.base.BaseActivity;

/**
 * Created by Administrator on 2018/2/24/024.
 */

public class RecordActivity extends BaseActivity {

    private surface surfaceView;
    private Camera camera;
    private Button tack;
    private LinearLayout container;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_record);
        surfaceView = new surface(this);
        container = findViewById(R.id.surface_contain);
        container.addView(surfaceView);
        tack = findViewById(R.id.tackpic);
        tack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                surfaceView.takePicture();
//                int numberOfCameras = Camera.getNumberOfCameras();
//                Camera.open(numberOfCameras);
            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
